home *** CD-ROM | disk | FTP | other *** search
/ Chip 1996 September / CHIP 1996 szeptember (CD07).zip / CHIP_CD07.ISO / povray30 / povmsdos.exe / POVMSDOS.ZIP / USER_WAT.DOC < prev    next >
Text File  |  1996-05-10  |  35KB  |  697 lines

  1. USER DOCUMENTATION FOR POV-Ray FOR MS-DOS USING WATCOM VERSION
  2.  
  3. 1.0   Introduction
  4.  
  5. The Watcom compiled version of POV-Ray is designated by either
  6. ".msdos.wat-cwa" or ".msdos.wat-d4g" after the POV-Ray version number on 
  7. the opening banner.  Everything in this document ONLY applies to that 
  8. version.  Other versions will operate under different rules.  This file is 
  9. NOT the only documentation for POV-Ray.  There is a file called 
  10. POVMSDOS.DOC which covers the MSDOS-specific features but that still isn't 
  11. everything.  There is a hypertext utility POVHELP.EXE that reads a file
  12. POVHELP.PHE which contains the main documentation for POV-Ray itself that 
  13. is common to all versions.  
  14.  
  15. This version has been compiled as a 32-bit DOS protected mode application.  
  16. It must be run on a 386 or higher system with at least 4 meg of memory.  
  17. More memory is preferred.
  18.  
  19. The program uses one of two different DOS extenders to manage memory and
  20. to create and use virtual memory swap files.  The "wat-cwa" version
  21. uses the CauseWay DOS extender written by Michael Devore & John Wildsmith.
  22. It is linked directly into the official POV-Ray executible.  If you
  23. are using an official version, this is the extender you will use.
  24.  
  25. Although the CauseWay authors have graciously donated a copy to the
  26. POV-Team, CauseWay is still very much a commercial product.  We cannot 
  27. include it with the free source code for POV-Ray for you compile-it-yourself 
  28. people.  You will have to purchase it directly from the authors.
  29.  
  30. Alternatly, another DOS extender called DOS4GW is supplied with the
  31. Watcom compiler.  However it is limited to a total of 32meg of memory.
  32. If your version is designated "wat-d4g" it uses the DOS4GW extender.
  33. The instructions below explain how CauseWay and DOS4GW use memory.  Do
  34. not try to use CauseWay variables with DOS4GW or vice-versa.
  35.  
  36. Be sure to read POVMSDOS.DOC and run POVHELP to make sure you have all the 
  37. remaining documentation.  This file only applies to the Watcom compiled 
  38. version.  Also read POVWHERE.GET for more information on POV-Ray archives 
  39. and support information.
  40.  
  41. ---------------------------------------------------------------------------
  42.                     CAUSEWAY DOS EXTENDER CONFIGURATION
  43.  
  44. Excerpted from Chapter 1 of the CauseWay DOS Extender User's Manual.  
  45. It is (c) Copyright 1992-1996 by Michael Devore.
  46. Used by permission.
  47.  
  48. Postal:         Devore Software & Consulting
  49.                 PO Box 4283
  50.                 Naperville, IL  60567-4283
  51.                 USA
  52. CompuServe:     71540,62
  53. Internet:       71540.62@compuserve.com
  54. Telephone:      1-708-717-6369
  55. Fax:            1-708-717-6373
  56. BBS:            1-708-717-9679
  57.  
  58. Note: The 708 area code changes to 630 in August of 1996.
  59.  
  60.  
  61. INTRODUCTION
  62.  
  63. What is CauseWay for Watcom C++ and Assembly Language?
  64. CauseWay is a 386 DOS extender package for use with Watcom C++ and
  65. assembly language programs. It consists of a DOS extender, provided as
  66. a stub EXE for Watcom C++ applications.
  67.  
  68. Within the standard DOS, and Windows and OS/2 DOS box
  69. environments, CauseWay supports very large memory models for
  70. applications on PC compatibles with an 80386SX processor or above
  71. without the need to use overlays or crude stopgap measures such as
  72. EMS/XMS swapping. To do this, the DOS extender runs applications in
  73. protected mode, rather than the real mode normally used in the DOS
  74. environments. CauseWay supports both 16-bit and 32-bit protected mode
  75. applications operating under a DOS environment.  It makes full use of
  76. 386-level chip capabilities including demand paging of code and data,
  77. variable-sized segments up to 4G in length, mixing 16- and 32-bit
  78. segments as well as support for flat (non-segmented) memory addressing
  79. models. The CauseWay implementation of these powerful capabilities
  80. provides all their benefits while being transparent to the application user.
  81.  
  82. Applications created using CauseWay are compatible with the VCPI and
  83. DPMI standards and run equally well on systems with no protected mode
  84. drivers or programs. CauseWay applications work with such diverse
  85. environments as normal DOS, DesqView, Windows 3.0 and above in
  86. both standard and enhanced modes, as well as DOS windows within OS/2
  87. 2.0 and above. CauseWay allocates memory from DPMI, VCPI, XMS,
  88. and INT 15H services, in addition to conventional DOS memory. This
  89. allows CauseWay applications to allocate memory through the CauseWay
  90. DOS extender without the need to detect or manipulate the various
  91. memory handling schemes.
  92.  
  93. MINIMUM SYSTEM REQUIREMENTS
  94.  
  95. CauseWay for Watcom C++ and Assembly Language requires a 386SX
  96. based computer or better. The required operating environment is MS-
  97. DOS or PC-DOS 3.1 or higher, Windows 3.0 or higher, OS/2 2.0 and
  98. above, or compatible operating system that provides a DPMI or VCPI
  99. DOS environment. 
  100.  
  101. DOS 3.3+ and a 386 machine or better are necessary to run CauseWay
  102. applications.
  103.  
  104. CAUSEWAY MEMORY REQUIREMENTS
  105.  
  106. The recommended minimum amount of total free physical memory for
  107. CauseWay applications is 500K total. 100-150K of this memory must be
  108. conventional DOS memory, the remainder may be extended memory.
  109. CauseWay applications can run in less memory, down to the 300K range,
  110. provided sufficient virtual (disk-based) memory is available, but
  111. application performance will decline significantly. More physical
  112. memory improves a program's performance, reducing virtual memory
  113. disk access overhead.
  114.  
  115. When running the DOS-extended application, DOS first loads the
  116. CauseWay DOS extender in conventional memory. CauseWay
  117. establishes the protected mode environment, retrieves the application from
  118. the executable file - loading it first into extended memory, then
  119. conventional memory if extended is exhausted, then virtual (disk-based)
  120. memory if conventional is exhausted - sets up the application for
  121. execution, and finally passes control to the application to begin operation.
  122.  
  123. No additional files are required to make your application run in 386
  124. protected mode using the CauseWay DOS extender.
  125.  
  126. OPERATIONAL CONSIDERATIONS WHEN USING CAUSEWAY
  127.  
  128. The TEMP, TMP, and CAUSEWAY=SWAP environment variables are
  129. used by CauseWay to determine where to build its virtual memory swap
  130. file when an application is not operating under Windows or OS/2
  131. (Windows and OS/2 use their own virtual memory files). Since
  132. CauseWay has integrated virtual memory, disk space is considered part of
  133. total memory. If you use the TEMP, TMP, or SWAP environment
  134. variable to point to a small RAM disk or almost full disk, free memory
  135. will be affected accordingly. If virtual (disk-based) memory is less than
  136. physical (installed on machine) memory, Cause Way turns off virtual
  137. memory. On the other hand, if you have a disk 300M free, CauseWay
  138. will have no problem reporting 300M free memory to your program,
  139. provided that virtual memory is not inhibited or limited by the
  140. CAUSEWAY environment variable memory settings.
  141.  
  142. Memory operates differently under Windows and OS/2. With OS/2, the
  143. DPMI setting for the session determines available memory. With
  144. Windows, available memory is the total of physical memory plus the
  145. swap file size less any memory already in use by Windows or another
  146. Windows application.
  147.  
  148. When creating a VMM swap file at application startup under DOS,
  149. CauseWay builds a list of possible paths in order of priority. CauseWay
  150. then works through the list until one of the entries provides both a valid
  151. drive and path specification and sufficient free space to begin operation.
  152. The first entry to succeed becomes the swap file drive with no further
  153. processing of the list. If CauseWay reaches the end of the list without
  154. finding a valid drive, it disables the virtual memory manager. The order
  155. of priority is: CAUSEWAY=SWAP, TEMP, TMP, and application
  156. execution path.
  157.  
  158. If endusers reboot the system or turn off power while executing a
  159. CauseWay application under DOS, a temporary file will be left on the
  160. system by CauseWay. This will usually be a zero length file unless the
  161. application was large enough to exceed physical memory and CauseWay
  162. had started using its virtual memory manager. The temporary file name
  163. is requested using standard DOS functions, meaning the name will vary
  164. with different versions of DOS. It typically is a mixture of letters and
  165. numbers with no extension, although a .$$$ extension may be presented
  166. when operating under a network. Make sure you do not delete this
  167. temporary file while the CauseWay application is still active, as improper
  168. or erratic program operation, including lockups, may occur.
  169.  
  170. Application startup times may increase significantly if free physical
  171. memory is less than the executable size. In such cases, not only must the
  172. executable be loaded into physical memory, but a virtual memory file of
  173. the executable file size must also be built. This file holds the portions of
  174. the executable that do not fit into physical memory and which have not
  175. been recently accessed. After startup is complete, the program will
  176. operate normally, paging to and from virtual memory as necessary.
  177.  
  178. CauseWay automatically sets aside 32K of low DOS memory for
  179. allocation and use by developer routines via the GetMemDOS API
  180. function. The 32K memory block is available even if CauseWay needs to
  181. use virtual memory just to load an application. The set-aside amount can
  182. be increased by using the CAUSEWAY environment variable LOWMEM
  183. option although the additional set-aside goal is not guaranteed to be
  184. reached if too little conventional memory is left for CauseWay's
  185. operating requirements.
  186.  
  187. ENVIRONMENT VARIABLES
  188.  
  189. CauseWay can make use of three environment variables at runtime:
  190. TEMP, TMP, and CAUSEWAY. 
  191.  
  192. TEMP and TMP Environment Variables
  193.  
  194. The TEMP and TMP environment variables specify the directory and
  195. drive where a swap file is built by CauseWay's virtual memory manager
  196. (VMM) when operating under DOS. Windows and OS/2 provide their
  197. own memory management functions which override CauseWay's use of
  198. the TEMP and TMP environment variables. The path indicated by
  199. TEMP will be used under DOS if both TEMP and TMP environment
  200. variables exist. Both settings are superseded by the
  201. CAUSEWAY=SWAP environment variable setting.
  202.  
  203. SET TMP=C:\SWAP
  204.  
  205. The example above directs the CauseWay DOS extender to create its
  206. swap file, if any, in the C:\SWAP directory. 
  207.  
  208. If no TEMP, TMP and CAUSEWAY=SWAP settings are present or are
  209. invalid, the current drive is used when creating a swap file. If free drive
  210. space is less than physical memory (extended and conventional) available
  211. at startup, then the DOS extender VMM is disabled, no swap file is
  212. created, and virtual memory is not available to the application.
  213.  
  214. CAUSEWAY Environment Variable
  215.  
  216. The CAUSEWAY environment variable controls operation of the DOS
  217. extender at application runtime. Seven options are supported, although
  218. they are ignored in a Window or OS/2 DPMI environment. Use any
  219. combination of the seven options in the following format:
  220.  
  221. SET CAUSEWAY=[setting_1;] [setting 2;] [setting_n;]
  222.  
  223. Items in brackets ([ ]) are optional. Do not actually type the brackets if
  224. you use the optional items. Items in italics should be replaced with actual
  225. values, separated by semicolons. Following is a description of the seven 
  226. valid settings:
  227.  
  228. DPMI          Force DPMI rather than default VCPI usage whenever    
  229.               possible (recommended for 386^Max and BlueMax         
  230.               users). The memory manager must support DPMI or       
  231.               else this setting is ignored.                         
  232.              
  233. EXTALL        Force CauseWay to use all extended memory and sub-     
  234.               allocate memory from the bottom up instead of the      
  235.               default top-down approach. This setting is most useful 
  236.               for processor intensive enviromnents which have a      
  237.               small hardware CPU cache. Use of this setting means    
  238.               that no extended memory will be available for other    
  239.               programs while the application is loaded (including    
  240.               shelling to DOS).                                      
  241.  
  242. HIMEM:nnn     Set maximum physical (conventional plus extended)     
  243.               memory that can be consumed by CauseWay. "nnn" is       
  244.               the decimal number of kilobytes that can be consumed. 
  245.               If memory allocation requests exceed this figure,     
  246.               CauseWay will use virtual memory, even if additional  
  247.               physical memory is present. If the HIMEM memory       
  248.               value exceeds available physical memory, then memory  
  249.               allocations operate normally. For example,            
  250.               HIMEM:2048 on a 4M machine would force virtual        
  251.               memory use after 2M of memory allocations (including  
  252.               loading the executable file). The remaining 2M of     
  253.               memory could be used by other applications while the  
  254.               CauseWay application is active.                       
  255.  
  256. LOWMEM:nnn    Set DOS (conventional) memory to restrict it from use  
  257.               by CauseWay. This memory is in addition to the           
  258.               default 32K low DOS memory block reserved by             
  259.               CauseWay for use by any applications which need to       
  260.               allocate DOS memory. nnn is the decimal number of        
  261.               kilobytes to reserve. If there is not enough             
  262.               conventional memory to satisfy the nnn request value     
  263.               then CauseWay will leave all conventional memory         
  264.               free that is not required by the extender to operate.    
  265.               Note that tnis option does not guarantee the amount of   
  266.               free DOS memory, just how much needs to be free          
  267.               before CauseWay will consume DOS memory after            
  268.               exhausting all extended memory. For example,             
  269.               LOWMEM:200 will attempt to reserve 200K of DOS           
  270.               memory, even if CauseWay has exhausted all extended      
  271.               memory and is using conventional memory to fill          
  272.               memory allocation requests.                              
  273.  
  274. MAXMEM:nnn    Set maximum linear address space provided by           
  275.               CauseWay. nnn is the decimal number of megabytes of    
  276.               linear address space. This setting is similar to HIMEM 
  277.               except that it includes any virtual memory. For        
  278.               example, MAXMEM:32 on a 16M memory system              
  279.               restricts VMM disk space usage to 32M, even if more    
  280.               disk space is present. MAXMEM:8 on the same            
  281.               system would restrict the application to 8M of memory  
  282.               (all physical). Note that the setting is in megabytes, 
  283.               rather than kilobytes used in the LOWMEM and           
  284.               HIMEM options.                                         
  285.  
  286. NOVM          Disable all virtual memory use by CauseWay. If  
  287.               physical memory is exhausted, CauseWay will fail
  288.               further memory allocation requests.             
  289.  
  290. SWAP:path     Set CauseWay's virtual memory manager swap file  
  291.               path. This path takes precedence for choosing the
  292.               location of a swap file over the TEMP and TMP    
  293.               environment variables.                           
  294.  
  295. ---------------------------------------------------------------------------
  296. This concludes the information on the CauseWay DOS Extender which is
  297. linked into the official POV-Ray executible.  The information below
  298. applies ONLY if you have compiled the program yourself using the Watcom
  299. compiler and the DOS4GW extender.
  300.  
  301. ---------------------------------------------------------------------------
  302. ---------------------------------------------------------------------------
  303.                      DOS/4GW Configuration Guide
  304.  
  305.                   WATCOM International Corporation
  306.  
  307.                       Waterloo, Ontario, Canada
  308.  
  309. This chapter explains how to use the DOS4G environment variable to
  310. suppress the banner that is displayed by DOS/4GW at startup.  It also
  311. explains how to use the DOS16M environment variable to select the switch
  312. mode setting, if necessary, and to specify the range of extended memory in
  313. which DOS/4GW will operate.  DOS/4GW is based on Rational Systems' DOS/16M
  314. 16-bit Protected-Mode support; hence the DOS16M environment variable name
  315. remains unchanged.
  316.  
  317. 1.1 Suppressing the DOS/4GW Banner
  318.  
  319. The banner that is displayed by DOS/4GW at startup can be suppressed by
  320. issuing the following command:
  321.  
  322.   set DOS4G=quiet
  323.  
  324. Do not insert a space between DOS4G and the equal sign.  A space to the
  325. right of the equal sign is optional.
  326.  
  327. 1.2 Changing the Switch Mode Setting
  328.  
  329. In almost all cases, DOS/4GW programs can detect the type of machine that
  330. is running and automatically choose an appropriate real- to protected-mode
  331. switch technique.  For the few cases in which this default setting does
  332. not work we provide the DOS16M DOS environment variable, which overrides
  333. the default setting.
  334.  
  335. Change the switch mode settings by issuing the following command:
  336.  
  337.   set DOS16M=value
  338.  
  339. Do not insert a space between DOS16M and the equal sign.  A space to the
  340. right of the equal sign is optional.
  341.  
  342. The table below lists the machines and the settings you would use with
  343. them.  Many settings have mnemonics, listed in the column "Alternate
  344. Name", that you can use instead of the number.  Settings that you must set
  345. with the DOS16M variable have the notation req'd in the first column.
  346. Settings you may use are marked option, and settings that will
  347. automatically be set are marked auto.
  348.  
  349. +------+---------------+-------+---------+-----------------------------------+
  350. |      |               |       |Alternate|                                   |
  351. |Status|Machine        |Setting|Name     |Comment                            |
  352. +------+---------------+-------+---------+-----------------------------------+
  353. |auto  |386/486 w/ DPMI|0      |None     |Set automatically if DPMI is active|
  354. |req'd |NEC 98-series  |1      |9801     |Must be set for NEC 98-series      |
  355. |auto  |PS/2           |2      |None     |Set automatically for PS/2         |
  356. |auto  |386/486        |3      |386,80386|Set automatically for 386 or 486   |
  357. |auto  |386            |INBOARD|None     |386 with Intel Inboard             |
  358. |req'd |Fujitsu FMR-70 |5      |None     |Must be set for Fujitsu FMR-70     |
  359. |auto  |386/486 w/ VCPI|11     |None     |Set automatically if VCPI detected |
  360. |req'd |Hitachi B32    |14     |None     |Must be set for Hitachi B32        |
  361. |req'd |OKI if800      |15     |None     |Must be set for OKI if800          |
  362. |option|IBM PS/55      |16     |None     |May be needed for some PS/55s      |
  363. +------+---------------+-------+---------+-----------------------------------+
  364.  
  365. The following procedure shows you how to test the switch mode setting.
  366.  
  367.   1. If you have one of the machines listed below, set the DOS16M
  368.     environment variable to the value shown for that machine and specify a
  369.     range of extended memory.  For example, if your machine is an NEC
  370.     98-series, set DOS16M=1 @2M-4M.  See the section, "Fine Control of
  371.     Memory Usage" later in this chapter for more information about setting
  372.     the memory range.
  373.  
  374.        +--------------------+---------+
  375.        | Machine            | Setting |
  376.        +--------------------+---------+
  377.        | NEC 98-series      | 1       |
  378.        | Fujitsu FMR-60,-70 | 5       |
  379.        | Hitachi B32        | 14      |
  380.        | OKI if800          | 15      |
  381.        +--------------------+---------+
  382.  
  383.     Before running DOS/4GW applications, check the switch mode setting by
  384.     following this procedure:
  385.  
  386.   2. Run PMINFO and note the switch setting reported on the last line of
  387.     the display.  (PMINFO, which reports on the protected-mode resources
  388.     available to your programs, is described in more detail in the
  389.     chapter, "Utilities".)
  390.  
  391.     If PMINFO runs, the setting is usable on your machine.
  392.  
  393.   3. If you changed the switch setting, add the new setting to your
  394.     AUTOEXEC.BAT file.
  395.  
  396. Note:  PMINFO will run successfully on 286 machines.  If your DOS/4GW
  397. application does not run, and PMINFO does, check the CPU type reported on
  398. the first line of the display.
  399.  
  400. You are authorized (and encouraged) to distribute PMINFO to your
  401. customers.  You may also include a copy of this section in your
  402. documentation.
  403.  
  404. 1.3 Fine Control of Memory Usage
  405.  
  406. In addition to setting the switch mode as described above, the DOS16M
  407. environment variable enables you to specify which portion of extended
  408. memory DOS/4GW will use.  The variable also allows you to instruct DOS/4GW
  409. to search for extra memory and use it if it is present.
  410.  
  411. 1.3.1 Specifying a Range of Extended Memory
  412.  
  413. Normally, you don't need to specify a range of memory with the DOS16M
  414. variable.  You must use the variable, however, in the following cases:
  415.  
  416.   * You are running on a Fujitsu FMR-series, NEC 98-series, OKI
  417.    if800-series or Hitachi B-series machine.
  418.  
  419.   * You have older programs that use extended memory but don't follow one
  420.    of the standard disciplines.
  421.  
  422.   * You want to shell out of DOS/4GW to use another program that requires
  423.    extended memory.
  424.  
  425. If none of these conditions applies to you, you can skip this section.
  426.  
  427. The general syntax is:
  428.  
  429.   set DOS16M= [switch_mode] [@start_address [- end_address]] [:size]
  430.  
  431. In the syntax shown above, start_address, end_address and size represent
  432. numbers, expressed in decimal or in hexadecimal (hex requires a 0x
  433. prefix).  The number may end with a K to indicate an address or size in
  434. kilobytes, or an M to indicate megabytes.  If no suffix is given, the
  435. address or size is assumed to be in kilobytes.  If both a size and a range
  436. are specified, the more restrictive interpretation is used.
  437.  
  438. The most flexible strategy is to specify only a size.  However, if you are
  439. running with other software that does not follow a convention for
  440. indicating its use of extended memory, and these other programs start
  441. before DOS/4GW, you will need to calculate the range of memory used by the
  442. other programs and specify a range for DOS/4GW programs to use.
  443.  
  444. DOS/4GW ignores specifications (or parts of specifications) that conflict
  445. with other information about extended memory use.  Below are some examples
  446. of memory usage control:
  447.  
  448. set DOS16M= 1 @2m-4m    Mode 1, for NEC 98-series machines, and use
  449.                         extended memory between 2.0 and 4.0MB.
  450.  
  451. set DOS16M= :1M         Use the last full megabyte of extended memory, or
  452.                         as much as available limited to 1MB.
  453.  
  454. set DOS16M= @2m         Use any extended memory available above 2MB.
  455.  
  456. set DOS16M= @ 0 - 5m    Use any available extended memory from 0.0 (really
  457.                         1.0) to 5.0MB.
  458.  
  459. set DOS16M= :0          Use no extended memory.
  460.  
  461. As a default condition DOS/4GW applications take all extended memory that
  462. is not otherwise in use.  Multiple DOS/4GW programs that execute
  463. simultaneously will share the reserved range of extended memory.  Any
  464. non-DOS/4GW programs started while DOS/4GW programs are executing will
  465. find that extended memory above the start of the DOS/4GW range is
  466. unavailable, so they may not be able to run.  This is very safe.  There
  467. will be a conflict only if the other program does not check the BIOS
  468. configuration call (Interrupt 15H function 88H, get extended memory size).
  469.  
  470. To create a private pool of extended memory for your DOS/4GW application,
  471. use the PRIVATXM program, described in the chapter, "Utilities".
  472.  
  473. The default memory allocation strategy is to use extended memory if
  474. available, and overflow into DOS (low) memory.
  475.  
  476. In a VCPI or DPMI environment, the start_address and end_address arguments
  477. are not meaningful.  DOS/4GW memory under these protocols is not allocated
  478. according to specific addresses because VCPI and DPMI automatically
  479. prevent address conflicts between extended memory programs.  You can
  480. specify a size for memory managed by VCPI or DPMI, but DOS/4GW will not
  481. necessarily allocate this memory from the highest available extended
  482. memory address, as it does for memory managed under other protocols.
  483.  
  484. 1.3.2 Using Extra Memory
  485.  
  486. Some machines contain extra non-extended, non-conventional memory just
  487. below 16MB.  When DOS/4GW runs on a Compaq 386, it automatically uses this
  488. memory because the memory is allocated according to a certain protocol,
  489. which DOS/4GW follows.  Other machines have no protocol for allocating
  490. this memory.  To use the extra memory that may exist on these machines,
  491. set DOS16M with the + option.
  492.  
  493.   set DOS16M=+
  494.  
  495. Setting the + option causes DOS/4GW to search for memory in the range from
  496. FA0000 to FFFFFF and determine whether the memory is usable.  DOS/4GW does
  497. this by writing into the extra memory and reading what it has written.  In
  498. some cases, this memory is mapped for DOS or BIOS usage, or for other
  499. system uses.  If DOS/4GW finds extra memory that is mapped this way, and
  500. is not marked read-only, it will write into that memory.  This will cause
  501. a crash, but won't have any other effect on your system.
  502.  
  503. 1.4 Setting Runtime Options
  504.  
  505. The DOS16M environment variable sets certain runtime options for all
  506. DOS/4GW programs running on the same system.
  507.  
  508. To set the environment variable, the syntax is:
  509.  
  510.   set DOS16M=[switch_mode_setting]^options.
  511.  
  512. Note:  Some command line editing TSRs, such as CED, use the caret (^) as a
  513. delimiter.  If you want to set DOS16M using the syntax above while one of
  514. these TSRs is resident, modify the TSR to use a different delimiter.
  515.  
  516. These are the options:
  517.  
  518. 0x01       check A20 line -- This option forces DOS/4GW to wait until the
  519.            A20 line is enabled before switching to protected mode.  When
  520.            DOS/4GW switches to real mode, this option suspends your
  521.            program's execution until the A20 line is disabled, unless an
  522.            XMS manager (such as HIMEM.SYS) is active.  If an XMS manager
  523.            is running, your program's execution is suspended until the A20
  524.            line is restored to the state it had when the CPU was last in
  525.            real mode.  Specify this option if you have a machine that runs
  526.            DOS/4GW but is not truly AT-compatible.  For more information
  527.            on the A20 line, see the section, "Controlling Address Line
  528.            A20" in this chapter.
  529.  
  530. 0x02       prevent initialization of VCPI -- By default, DOS/4GW searches
  531.            for a VCPI server and, if one is present, forces it on.  This
  532.            option is useful if your application does not use EMS
  533.            explicitly, is not a resident program, and may be used with
  534.            386-based EMS simulator software.
  535.  
  536. 0x04       directly pass down keyboard status calls -- When this option is
  537.            set, status requests are passed down immediately and
  538.            unconditionally.  When disabled, pass-downs are limited so the
  539.            8042 auxiliary processor does not become overloaded by keyboard
  540.            polling loops.
  541.  
  542. 0x10       restore only changed interrupts -- Normally, when a DOS/4GW
  543.            program terminates, all interrupts are restored to the values
  544.            they had at the time of program startup.  When you use this
  545.            option, only the interrupts changed by the DOS/4GW program are
  546.            restored.
  547.  
  548. 0x20       set new memory to 00 -- When DOS/4GW allocates a new segment or
  549.            increases the size of a segment, the memory is zeroed.  This
  550.            can help you find bugs having to do with uninitialized memory.
  551.            You can also use it to provide a consistent working environment
  552.            regardless of what programs were run earlier.  This option only
  553.            affects segment allocations or expansions that are made through
  554.            the DOS/4GW kernel (with DOS function 48H or 4AH).  This option
  555.            does not affect memory allocated with a compiler's malloc
  556.            function.
  557.  
  558. 0x40       set new memory to FF -- When DOS/4GW allocates a new segment or
  559.            increases the size of a segment, the memory is set to 0xFF
  560.            bytes.  This is helpful in making reproducible cases of bugs
  561.            caused by using uninitialized memory.  This option only affects
  562.            segment allocations or expansions that are made through the
  563.            DOS/4GW kernel (with DOS function 48H or 4AH).  This option
  564.            does not affect memory allocated with a compiler's malloc
  565.            function.
  566.  
  567. 0x80       new selector rotation -- When DOS/4GW allocates a new selector,
  568.            it usually looks for the first available (unused) selector in
  569.            numerical order starting with the highest selector used when
  570.            the program was loaded.  When this option is set, the new
  571.            selector search begins after the last selector that was
  572.            allocated.  This causes new selectors to rotate through the
  573.            range.  Use this option to find references to stale selectors,
  574.            i.e., segments that have been cancelled or freed.
  575.  
  576. 1.5 Controlling Address Line 20
  577.  
  578. This section explains how DOS/4GW uses address line 20 (A20) and describes
  579. the related DOS16M environment variable settings.  It is unlikely that you
  580. will need to use these settings.
  581.  
  582. Because the 8086 and 8088 chips have a 20-bit address spaces, their
  583. highest addressable memory location is one byte below 1MB.  If you specify
  584. an address at 1MB or over, which would require a twenty-first bit to set,
  585. the address wraps back to zero.  Some parts of DOS depend on this wrap, so
  586. on the 286 and 386, the twenty-first address bit is disabled.  To address
  587. extended memory, DOS/4GW enables the twenty-first address bit (the A20
  588. line).  The A20 line must be enabled for the CPU to run in protected mode,
  589. but it may be either enabled or disabled in real mode.
  590.  
  591. By default, when DOS/4GW returns to real mode, it disables the A20 line.
  592. Some software depends on the line being enabled.  DOS/4GW recognizes the
  593. most common software in this class, the XMS managers (such as HIMEM.SYS),
  594. and enables the A20 line when it returns to real mode if an XMS manager is
  595. present.  For other software that requires the A20 line to be enabled, use
  596. the A20 option.  The A20 option makes DOS/4GW restore the A20 line to the
  597. setting it had when DOS/4GW switched to protected mode.  Set the
  598. environment variable as follows:
  599.  
  600.   set DOS16M= A20
  601.  
  602. To specify more than one option on the command line, separate the options
  603. with spaces.
  604.  
  605. The DOS16M variable also lets you to specify the length of the delay
  606. between a DOS/4GW instruction to change the status of the A20 line and the
  607. next DOS/4GW operation.  By default, this delay is 1 loop instruction when
  608. DOS/4GW is running on a 386 machine.  In some cases, you may need to
  609. specify a longer delay for a machine that will run DOS/4GW but is not
  610. truly AT-compatible.  To change the delay, set DOS16M to the desired
  611. number of loop instructions, preceded by a comma:
  612.  
  613.   set DOS16M=,loops
  614.  
  615. 2.0  VMM
  616.  
  617. The Virtual Memory Manager (VMM) uses a swap file on disk to augment RAM.
  618. With VMM you can use more memory than your machine actually has.  When RAM
  619. is not sufficient, part of your program is swapped out to the disk file
  620. until it is needed again.  The combination of the swap file and available
  621. RAM is the virtual memory.
  622.  
  623. Your program can use VMM if you set the DOS environment variable, DOS4GVM,
  624. as follows.  To set the DOS4GVM environment variable, use the format shown
  625. below.
  626.  
  627.   set DOS4GVM= [option[#value]] [option[#value]]
  628.  
  629. A "#" is used with options that take values since the DOS command shell
  630. will not accept "=".
  631.  
  632. If you set DOS4GVM equal to 1, the default parameters are used for all
  633. options.
  634.  
  635. Example:
  636.   C>set DOS4GVM=1
  637.  
  638. 2.1 VMM Default Parameters
  639.  
  640. VMM parameters control the options listed below.
  641.  
  642. MINMEM      The minimum amount of RAM managed by VMM.  The default is
  643.             512KB.
  644.  
  645. MAXMEM      The maximum amount of RAM managed by VMM.  The default is 4MB.
  646.  
  647. SWAPMIN     The minimum or initial size of the swap file.  If this option
  648.             is not used, the size of the swap file is based on VIRTUALSIZE
  649.             (see below).
  650.  
  651. SWAPINC     The size by which the swap file grows.
  652.  
  653. SWAPNAME    The swap file name.  The default name is "DOS4GVM.SWP".  By
  654.             default the file is in the root directory of the current
  655.             drive.  Specify the complete path name if you want to keep the
  656.             swap file somewhere else.
  657.  
  658. DELETESWAP  Whether the swap file is deleted when your program exits.  By
  659.             default the file is not deleted.  Program startup is quicker
  660.             if the file is not deleted.
  661.  
  662. VIRTUALSIZE The size of the virtual memory space.  The default is 16MB.
  663.  
  664. 2.2 Changing the Defaults
  665.  
  666. You can change the defaults in two ways.
  667.  
  668.   1. Specify different parameter values as arguments to the DOS4GVM
  669.     environment variable, as shown in the example below.
  670.  
  671.       set DOS4GVM=deleteswap maxmem#8192
  672.  
  673.   2. Create a configuration file with the filetype extension ".VMC", and
  674.     call that as an argument to the DOS4GVM environment variable, as shown
  675.     below.
  676.  
  677.       set DOS4GVM=@NEW4G.VMC
  678.  
  679. 2.2.1 The .VMC File
  680.  
  681. A ".VMC" file contains VMM parameters and settings as shown in the example
  682. below.  Comments are permitted.  Comments on lines by themselves are
  683. preceded by an exclamation point (!).  Comments that follow option
  684. settings are preceded by white space.  Do not insert blank lines:
  685. processing stops at the first blank line.
  686.  
  687.   !Sample .VMC file
  688.   !This file shows the default parameter values.
  689.   minmem = 512            At least 512K bytes of RAM is required.
  690.   maxmem = 4096           Uses no more than 4MB of RAM
  691.   virtualsize = 16384     Swap file plus allocated memory is 16MB
  692.   !To delete the swap file automatically when the program exits, add
  693.   !deleteswap
  694.   !To store the swap file in a directory called SWAPFILE, add
  695.   !swapname = c:\swapfile\dos4gvm.swp
  696.  
  697.